package com.yf.cmw.constant;

public class BussConstant {
    /**
     * 默认轮循时间：15秒
     */
    public static int  TIME_INTERVAL = 15 * 1000;
    /**
     * U盘广告默认存储路径 YF_ADS -> U盘广告文件夹
     */
    public static final String USB_ADPATH = "/YF_ADS/";

    /**
     * 广告文件默认存储路径
     */
    public static final String DEFAULT_ADPATH = "/mnt/sdcard/yf/ADSource/";
    /**
     * 广告配置存储路径
     */
    public static final String DEFAULT_CONFIGPATH = "/mnt/sdcard/yf/ADConfiguration/";
    /**
     * 广告时日志文件默认存储路径
     */
    public static final String LOG_ADPATH = "/mnt/sdcard/yf/ADLog/YF-SPS/";
    /**
     * 播放器日志默认存储路径
     */
    public static final String DEFAULT_PLAYER_ADLOG = "/mnt/sdcard/yf/ADLog/YF-Player/";
    /**
     * 广告截图默认存储路径
     */
    public static final String  SCREENSHOT_ADPATH = "/mnt/sdcard/yf/ADScreenShot/";
    /**
     * 广告播放记录默认存储路径
     */
    public static final String  PLAYRECORD_ADPATH = "/mnt/sdcard/yf/ADPlayRecord/";

    /**
     * 生产环境地址
     */
    private static final String DEFAULT_SERVERPATH_PROD = "https://admin.yfkj-vip.com";
    /**
     * 测试环境地址
     */
    public static final String DEFAULT_SERVERPATH_TEST = "http://192.168.0.145:9092";
    /**
     * 开发环境地址
     */
    public static final String DEFAULT_SERVERPATH_DEV = "http://192.168.0.145:9092";


    public static final String ENV_PROD = "PROD"; //PROD:生产
    public static final String ENV_TEST = "TEST"; //TEST:测试
    public static final String ENV_DEV = "DEV"; //DEV:开发环境
    public static final String ENV = ENV_PROD; //PROD:生产，TEST:测试， DEV:开发环境

    /**
     * 获取服务器配置
     * @return
     */
    public static final String getUrl(){
        String url = DEFAULT_SERVERPATH_PROD;
        switch (ENV){
            case ENV_PROD:{
                url = DEFAULT_SERVERPATH_PROD;
                break;
            } case ENV_TEST:{
                url = DEFAULT_SERVERPATH_TEST;
                break;
            } case ENV_DEV:{
                url = DEFAULT_SERVERPATH_DEV;
                break;
            }
        }
        return url;
    }

    /**
     * 议峰Player 播放器包名
     */
    public static final String PACKAGE_YF_PLAYER_APP = "com.media.yiti.ytplayer";
    public static final String ACTION_AD_ADDED = "com.media.yf.cmw.ACTION_AD_ADDED";
    public static final String ACTION_AD_REMOVED = "com.media.yf.cmw.ACTION_AD_REMOVED";
    public static final String ACTION_APK_INSTALL = "com.media.yf.cmw.ACTION_APK_INSTALL";  //YF-Player 安装通知
    public static final String ACTION_ELEVATOR_DOOR_OPEN = "com.mstar.android.intent.send.EFUN.PLAYER_PAUSE";
    public static final String ACTION_ELEVATOR_DOOR_CLOSE = "com.mstar.android.intent.send.EFUN.PLAYER_PLAY";

    /**
     * 命令--【广告添加:1]
     */
    public static final int CMD_AD_ADD = 1;
    /**
     * 命令--【广告删除:2]
     */
    public static final int CMD_AD_DEL = 2;
    /**
     * 命令--【广告截屏:3]
     */
    public static final int CMD_AD_SCREEN = 3;


    //*******--- 业务常量标识 [MainPresenter] CODE START ---******//
    public static final String SERVER_URL_KEY = "server_url";
    /**
     * 获取机器配置
     */
    public static final int BUSS_FLAG_1 = 1;
    /**
     * 服务器联网测试
     */
    public static final int BUSS_FLAG_2 = 2;
    /**
     * 服务器联网测试
     */
    public static final int BUSS_FLAG_3 = 3;
    /**
     * 广告下载
     */
    public static final int BUSS_FLAG_4 = 4;


    //*******--- 业务常量标识 [MainPresenter] CODE END ---******//

    //*******--- 服务器日志表 [MachineLogEntity] CODE START ---******//
    /**
     * 服务器指令 [心跳检查 : 1]
     */
    public static final int SCOMMAND_1 = 1;
    /**
     * 服务器指令 [期刊下载 : 2]
     */
    public static final int SCOMMAND_2 = 2;
    /**
     * 服务器指令 [下架期刊 : 3]
     */
    public static final int SCOMMAND_3 = 3;
    /**
     * 服务器指令 [报送日志 : 4]
     */
    public static final int SCOMMAND_4 = 4;
    /**
     * 服务器指令 [重启系统 : 5]
     */
    public static final int SCOMMAND_5 = 5;
    /**
     * 服务器指令 [APP升级 : 6]
     */
    public static final int SCOMMAND_6 = 6;
    /**
     * 服务器指令 [播放记录报送 : 7]
     */
    public static final int SCOMMAND_7 = 7;
    /**
     * 服务器指令 [截图文件报送 : 8]
     */
    public static final int SCOMMAND_8 = 8;
    /**
     * 服务器指令 [议峰智播日志报送 : 9]
     */
    public static final int SCOMMAND_9 = 9;
    /**
     * 服务器指令 [议峰光传日志报送 : 10]
     */
    public static final int SCOMMAND_10 = 10;
    //*******--- 服务器日志表 [MachineLogEntity] CODE END ---******//

    //*******--- 下载日志表 [DownloadLogEntity] CODE START ---******//
    /**
     * 业务类型 [1:广告文件]
     */
    public static final int BTYPE_1 = 1;
    /**
     * 业务类型 [2:软件升级文件]
     */
    public static final int BTYPE_2 = 2;

    /**
     * 下载状态 [0:未下载]
     */
    public static final int XSTATUS_0 = 0;
    /**
     * 下载状态 [1:下载中]
     */
    public static final int XSTATUS_1 = 1;
    /**
     * 下载状态 [2:下载成功]
     */
    public static final int XSTATUS_2 = 2;
    /**
     * 下载状态 [3:下载失败]
     */
    public static final int XSTATUS_3 = 3;

    /**
     * 下载状态 [1:上刊中]
     */
    public static final int SSTATUS_1 = 1;
    /**
     * 下载状态 [2:已上刊]
     */
    public static final int SSTATUS_2 = 2;
    /**
     * 下载状态 [3:已下架]
     */
    public static final int SSTATUS_3 = 3;
    //*******--- 下载日志表 [DownloadLogEntity] CODE END ---******//

    /**
     *  MainActivity 中的获取最新配默置 [1:获取最新配置What]
     */
    public static final int HANDLER_MAIN_FUN_PULLCFG = 1;
    /**
     *  MainActivity 中的检查更新提示 [2:检查更新提示What]
     */
    public static final int HANDLER_CHECK_UPDATE_CONFIRM = 2;
    /**
     *  MainActivity 中的APK下载进度 [3:APK下载进度What]
     */
    public static final int HANDLER_APK_DOWNLOAD_PROGRESS = 3;
    /**
     *  MainActivity 中的USB广告文件复制 [4:USB广告文件复制What]
     */
    public static final int HANDLER_USB_ADS_COPYS = 4;


    //***----------  U盘相关 CODE START -------------***//
    /**
     * U盘挂载类型  插入U盘 STATE_UNMOUNTED->STATE_MOUNTED;拔出U盘  STATE_EJECTING->STATE_UNMOUNTED->STATE_BAD_REMOVAL
     */
    //卸载
    public static final int STATE_UNMOUNTED = 0;
    //状态监测
    public static final int STATE_CHECKING = 1;
    //挂载完成
    public static final int STATE_MOUNTED = 2;
    //只读
    public static final int STATE_MOUNTED_READ_ONLY = 3;
    //格式化
    public static final int STATE_FORMATTING = 4;
    //开始移除
    public static final int STATE_EJECTING = 5;
    //无法挂载
    public static final int STATE_UNMOUNTABLE = 6;
    //删除
    public static final int STATE_REMOVED = 7;
    //移除完成
    public static final int STATE_BAD_REMOVAL = 8;
    /**
     * 接受广播key
     */
    public static final String ACTION_VOLUME_STATE_CHANGED = "android.os.storage.action.VOLUME_STATE_CHANGED";
    public static final String EXTRA_VOLUME_ID = "android.os.storage.extra.VOLUME_ID";
    public static final String EXTRA_VOLUME_STATE = "android.os.storage.extra.VOLUME_STATE";
    /**
     * 刚挂载和关闭
     */
    public static final String ACTION_USB_DEVICE_ATTACHED= "android.hardware.usb.action.USB_DEVICE_ATTACHED";
    public static final String ACTION_USB_DEVICE_DETACHED= "android.hardware.usb.action.USB_DEVICE_DETACHED";
    //***----------  U盘相关 CODE END -------------***//

    /**
     * 文件类型 [1: 下载期刊]
     */
    public static final int FILE_TYPE_1 = 1;
    /**
     * 文件类型 [2: 拷贝期刊]
     */
    public static final int FILE_TYPE_2 = 2;

    public static final String TEMP_FILE_PREFIX = ".tmp";
}
